﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ERPStore.Extensions;

namespace ERPStore.EventConsumers
{
	public class AppStopEventConsumer : EventBrokR.IConsumer<Events.EndApplicationRequestedEvent>
	{
		#region IConsumer<EndApplicationRequestedEvent> Members

		public void Handle(Events.EndApplicationRequestedEvent eventMessage)
		{
			var serviceBus = GlobalConfiguration.Configuration.DependencyResolver.GetService<ERPStore.Services.IServiceBus>();
			serviceBus.StopReading();
		}

		#endregion
	}
}
